<?php

namespace app\api\model;

use think\Model;

use app\api\model\Token;
use think\facade\Db;
use think\model\concern\SoftDelete;

/**
 * 用户模型
 */
class User extends Model
{
    use SoftDelete;

    protected $deleteTime = 'delete_time';


    // protected $name='servers_user';

    // 开启自动写入时间戳字段
    protected $auto_timestamp = 'false';
 
    
    public function cruise_left(){
        $list = Db::name("goods_qrcode_user")->where("status",0)->select();
        foreach($list as $k=>$v){
            if($v["failure_time"] <= time()){
                Db::name("goods_qrcode_user")->where("id",$v["id"])->update(["status"=>2]);
            }
        }
        return ["code"=>1];
    }


}
